package com.syq.controller;

import com.syq.pojo.Customer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: SearchController
 * @Description: TODO
 * @Create by: syq
 * @Date: 2022/8/16 11:39
 */

@RestController
@RequestMapping("/search")
public class SearchController {

    @Value("${server.port}")
    private String port;

    //@PostMapping("/list/{name}")
    @PostMapping("/list")
    //public String list(@PathVariable String name)
    public String list(@RequestParam String name)
    {
        return "我是搜索微服务，您正在访问......."+port+name;
    }

    @PostMapping("/pojo")
    public String pojo(@RequestBody Customer customer){

        return "我是搜索微服务，您正在访问......."+port+customer;
    }
}
